import 'package:json_annotation/json_annotation.dart';
import 'package:xindong/manager/network/xindong_networking.dart';
import 'package:xindong/utils/xindong_text_util.dart';

part 'xindong_task_class.g.dart';

@JsonSerializable()
class XinDongTaskClass {
  int? types; // 1新手 2 日常
  String? name;
  String? icon;
  String? description;
  String? msg;
  late String title;
  late String reward;

  XinDongTaskClass();

  String get iconUrl {
    if (TextUtil.isEmpty(icon)) {
      return "";
    }
    return XinDongNetworking.instance.fileUrl + icon!;
  } 
  
  factory XinDongTaskClass.fromJson(Map<String, dynamic> json) => _$XinDongTaskClassFromJson(json);

  Map<String, dynamic> toJson() => _$XinDongTaskClassToJson(this);
}
